package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtils;

import java.util.Date;


public class ClearOrderSettingJob {
    @Reference
    private OrderSettingService orderSettingService;

    public  void  clearOrderSetting(){
        Date today = new Date();
        try {
            String cleanDate = DateUtils.parseDate2String(today, "yyyy-MM-dd");
            Date cleanDate2 = DateUtils.parseString2Date(cleanDate);
            orderSettingService.clearOrderSetting(cleanDate2);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
